﻿using System;
using System.Collections.Generic;
using System.Text;
using IBLL;
using Model.WebService;
using BLL.Action.Transfer.WebService;
using AppToolKit.Core.Context.Spring;
 

namespace BLL.Action.Transfer
{
    [AutoWiring]
    public class WebserviceTransferBase : ITransfer
    {
        [AutoWiring]
        public WebServiceHelper WebServiceHelperHolder { get; set; }

      
        #region ITransfer Members

        public virtual object Excute(object obj)
        {
            throw new NotImplementedException();
        }


        public virtual object GetData(object obj1)
        {
            WebServiceParam obj = obj1 as WebServiceParam;
            //object obj2 = CacheHelper.Cache(Cache, obj.ClassName, delegate { return Getobject(obj.ClassName, obj.Url); });

            return WebServiceHelperHolder.InvokeWebService(obj.Url, obj.DataSource, obj.Tag);
        }
        //private object Getobject(string className,string url)
        //{
        //    Type t = Type.GetType(className);

        //    object o= Activator.CreateInstance(t);

        //    return AuthorParserHolder.GetSoapHeader(o);
        //}
        #endregion
    }
}
